package cn.edu.xmu.oomall.liquidation.config;

import cn.edu.xmu.oomall.liquidation.microservice.OnSaleService;
import cn.edu.xmu.oomall.liquidation.microservice.ShareActivityService;
import cn.edu.xmu.oomall.liquidation.microservice.ShareService;
import cn.edu.xmu.oomall.liquidation.microservice.ShopService;
import cn.edu.xmu.oomall.liquidation.model.bo.liquid.calc.BaseLiquidationItem;
import cn.edu.xmu.oomall.liquidation.model.bo.liquid.calc.CommissionLiquidationItem;
import cn.edu.xmu.oomall.liquidation.model.bo.liquid.calc.LiquidationCalc;
import cn.edu.xmu.oomall.liquidation.model.bo.liquid.calc.PointLiquidationItem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;

import java.util.ArrayList;

@Configuration
public class LiquidationCalcConfig {
    @Autowired
    private OnSaleService onSaleService;

    @Autowired
    private ShopService shopService;

    @Autowired
    private ShareActivityService shareActivityService;

    @Autowired
    private ShareService shareService;

    @Bean
    @DependsOn("getBeanUtil")
    public LiquidationCalc LiquidationCalc() {
        ArrayList<BaseLiquidationItem> liquidationItemList = new ArrayList<>();
        CommissionLiquidationItem commissionLiquidationItem = new CommissionLiquidationItem("commission");
        PointLiquidationItem pointLiquidationItem = new PointLiquidationItem("point");
        liquidationItemList.add(commissionLiquidationItem);
        liquidationItemList.add(pointLiquidationItem);

        LiquidationCalc liquidationCalc = new LiquidationCalc(liquidationItemList);
        return liquidationCalc;
    }
}
